package com.xsp.mybatisxmlsqlparser.service;

import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Service;

import java.io.File;
import java.util.List;

@Service
public class ReadXmlFilesService implements ReadFilesService {

    @Override
    public List<File> readFiles(String path, String suffix) {
        List<File> findFiles = ListUtil.empty();
        findFiles = FileUtil.loopFiles(path, file -> StrUtil.endWithIgnoreCase(file.getName(), suffix));
        return findFiles;
    }
}
